Imports Aricie.DNN.Caching
Imports Aricie.DNN

Namespace Aricie.DNN.Caching.Analysis
    <Serializable()> _
    Public Class KeyDistributionStatistic
        Implements IComparable(Of KeyDistributionStatistic)

        Public Sub New()

        End Sub

        Public Sub New(ByVal distrib As CacheDistributionType)
            Me.DistributionType = distrib
            Me.MeanTime = New STimeSpan(TimeSpan.MaxValue)
            Me.RatioToBest = -1
        End Sub

        Public Sub New(ByVal distrib As CacheDistributionType, ByVal meanTime As TimeSpan)
            Me.DistributionType = distrib
            Me.MeanTime = New STimeSpan(meanTime)
            Me.RatioToBest = -1
        End Sub


        Public DistributionType As CacheDistributionType
        Public MeanTime As STimeSpan
        Public RatioToBest As Integer

        Public Sub SetRatio(ByVal ratio As Integer)
            Me.RatioToBest = ratio
        End Sub

        Public Function CompareTo(ByVal other As KeyDistributionStatistic) As Integer Implements System.IComparable(Of KeyDistributionStatistic).CompareTo
            Return Me.MeanTime.Value.CompareTo(other.MeanTime.Value)
        End Function
    End Class
End Namespace